﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// Block Repository. Good example of CRUD operations.
    ///// </summary>
    public class BlockRepository : IBlockRepository
    {
        private static readonly IBlockDao _block= DataAccess.BlockDao;
        public List<Block> GetList()
        {
            return _block.GetBlock().ToList();
        }

        public Block Get(string id)
        {
            return _block.GetBlockByID(id);
        }

        public void Insert(Block t)
        {
            _block.InsertBlock(t);
        }

        public void Update(Block t)
        {
            _block.UpdateBlock(t);
        }

        public void Delete(Block t)
        {
            _block.DeleteBlock(t);
        }

        public List<Block> GetBlockBySchoolId(int schoolId)
        {
           return  _block.GetBlockBySchoolID(schoolId).ToList();
        }


        public List<Block> GetBlockBySchoolIdAndSchoolYear(string SchoolYearID, int schoolId)
        {
            throw new NotImplementedException();
        }
    }
}